| Conditions | 5 |
| Paths | 20 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import process from 'child_process' |
||
| 15 | var abeProcess = function(name, args = []) { |
||
| 16 | args = prepend(`ABE_WEBSITE=${config.root}`, args) |
||
| 17 | args = prepend(`ABEJS_PATH=${__dirname}/../../../dist`, args) |
||
| 18 | |||
| 19 | var file = `${__dirname}/../../cli/process/${name}.js` |
||
| 20 | try { |
||
| 21 | var stats = fse.statSync(file) |
||
| 22 | if (stats.isFile()) { |
||
| 23 | process.fork(file, args) |
||
| 24 | } |
||
| 25 | }catch(err) { |
||
| 26 | try { |
||
| 27 | file = Plugins.instance.getProcess(name) |
||
| 28 | stats = fse.statSync(file) |
||
| 29 | if (stats.isFile()) { |
||
| 30 | process.fork(file, args) |
||
| 31 | } |
||
| 32 | }catch(err) { |
||
| 33 | console.log('process fork failed') |
||
|
|
|||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | export default abeProcess |